<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
		<div>{{age}}</div>
		<div>{{reverse}}</div>
		<div>{{ageTrue}}</div>
		<!-- 计算属性是属性使用是不需要加框号 -->
	</div>

	
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
				age:'13'
            },methods: {
			
			},
			computed: {
				reverse:function(){
				//计算属性必须要return
					return this.age.split('').reverse().join('');
				},
				ageTrue:function(){
					return this.age>18?'成年':'未成年';
				}
			}
        })
    </script>
</body>

</html>